<%
'#################################################################################
'## UnWritten Open Source Blog Engine
'#################################################################################
'## Copyright (C) 2008 Luigi Violin
'##
'## This program is free software: you can redistribute it and/or modify
'## it under the terms of the GNU General Public License as published by
'## the Free Software Foundation, either version 2 of the License, or
'## (at your option) any later version.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program.  If not, see <http://www.gnu.org/licenses/>.
'##
'## You can obtain support from our forums at:
'##     <http://www.unwrittenblog.com/forums/>
'## Contact the author directly:
'##     <zaamit@hotmail.com/>
'##
'#################################################################################
%>
<!--#include virtual="/config.asp"-->
<!--#include virtual="/includes/constants.asp"-->
<!--#include virtual="/includes/vars.asp"-->
<!--#include virtual="/includes/core-functions.asp"-->
<!--#include virtual="/plugins/includes.asp"-->

<%
Session.LCID = 1033
'handle timezones
If Application("LastGMTCheck") = "" or Application("GMToffset")="" or DateDiff("h", Application("LastGMTCheck"), Now) > 24 Then
  Server.Execute "/includes/todayGMT.asp"
  Application("LastGMTCheck") = Now
End If
'db connection
'on error resume next
success = conn_db(cfg_serverip,cfg_port,cfg_db,cfg_user,cfg_pass)
if not success then
	response.Write "Error connecting to database, please check your connection string and server status."
	Response.End()
	else
	'load basic settings
	success = get_core_settings()
	'init vars
	if len(Session("u_name")) = 0 then
		Session("u_name") = "Guest"
		Session("u_level") = 0
	end if
end if
%>